package org.manon.json.hierarchy;

import org.manon.json.annotation.JSon;
import org.manon.json.annotation.JSonDiscriminator;
import org.manon.json.annotation.JSonDiscriminatorType;
import org.manon.json.annotation.JSonDiscriminatorValue;

@JSon(filterable = false)

public class Person {

	private String name;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@JSon(filterable = false)
	@JSonDiscriminator( type = JSonDiscriminatorType.PROPERTY , name = "disc", property = "disc")
	public static class Student extends Person{
		private String _common;
		private String _disc;
		public String getCommon() {
			return _common;
		}
		public void setCommon(String common) {
			_common = common;
		}
		public String getDisc() {
			return _disc;
		}
		public void setDisc(String disc) {
			_disc = disc;
		}
	}
	
	@JSon
	@JSonDiscriminatorValue("A")
	public static class StudentA extends Student {
		private String _field;
		public String getField() {
			return _field;
		}
		public void setField(String field) {
			_field = field;
		}
	}
	
	@JSon
	@JSonDiscriminatorValue("B")
	public static class StudentB extends Student {
		private String _method;
		public String getMethod() {
			return _method;
		}
		public void setMethod(String method) {
			_method = method;
		}
	}
}